#ifndef _SEMAPHORE_H__

#define _SEMAPHORE_H__

#include "xyu.h"

namespace util
{
    class Semaphore
    {
    public:
        explicit Semaphore(const int resource);
        ~Semaphore() = default;
        void release();
        void acquire();
    private:
        int resource_;
        std::mutex mtx_;
        std::condition_variable cond_;
    };
}

#endif // !_SEMAPHORE_H__
